﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Collections;
using System.Threading;
using System.IO.Compression;

namespace server
{
    class DeleteFolder
    {
        public bool Deletefolder(string dir)
        {
            try
            {
                if (Directory.Exists(dir))
                {
                    foreach (string d in Directory.GetFileSystemEntries(dir))
                    {
                        if (File.Exists(d))
                            File.Delete(d);
                        else
                            Deletefolder(d);
                    }
                    Directory.Delete(dir);
                    return true;
                }
                else
                    return false; 
            }
            catch (System.Exception e)
            {
                return false;
            }
           
        } 
    }
}
